package com.holyant.report.dto;

import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.util.List;
import java.util.Set;

/**
 * 运营报-模板dto
 * 
 * @author z
 * @date 2022-08-18
 */
@Data
@ApiModel("运营报-动态表")
public class BiReportDto {

    private List<BiReportSingleColumnDto> singleColumns;
    private MultiColumn totalColumns;
    private MultiColumn multiColumns;
    private List<JSONObject> list;

    @Data
    public static class MultiColumn {
        private Long width;
        private Set<ScopeVal> scopeVals;
        private List<BiReportMetricsKeyDto> metricsKeys;
    }

    @Data
    @EqualsAndHashCode
    @AllArgsConstructor
    @NoArgsConstructor
    public static class ScopeVal implements Comparable<ScopeVal> {
        private String valIndex;
        private String label;

        @Override
        public int compareTo(ScopeVal o) {
            return label.compareTo(o.label);
        }
    }

}
